package com.dingreading.cloud.admin.service;

import com.dingreading.cloud.admin.entity.DeliveryAddress;
import com.dingreading.cloud.admin.entity.OrderForm;
import com.dingreading.cloud.common.util.PageDto;
import com.dingreading.cloud.common.util.PageUtil;
import com.mybatisflex.core.service.IService;

import java.util.List;

/**
 * 服务层。
 *
 * @author Administrator
 * @since 2023-11-22
 */
public interface OrderFormService extends IService<OrderForm> {

    PageDto<OrderForm> pageListV2(
            PageUtil pageUtil, String keyword, Integer projectType, Integer roleType, Integer status,
            String beginDate, String endDate, String payChannelCode, Integer financeStatus, String goodsName
    );

    OrderForm getByCode(String staffUid, String code);

    // 删除订单
    int deleteByStaffIdAndCode(String staffUid, String code);

    //修改收货地址
    boolean updateAddress(String staffUid, String code, DeliveryAddress address);

    // 取消订单
    boolean cancelOrder(String staffUid, String code);

    // 取消赠品订单
    boolean revocationGiftOrder(String code, String staffUid, String staffName);

    // 确认订单
    boolean confirmOrder(String code);


    List<Long> getOperands(Integer roleType);


    // 修改订单的支付通道
    void updatePayChannelCode(String staffUid, String code, String payChannelCode);

    // 获取没有付款并使用代金券的订单
    List<OrderForm> getNoPayUseCouponForm(String storeUid, String staffUid, Long couponStaffId, String code);

    // 恢复已取消的订单
    boolean resumeOrder(String code, Integer status, String statusName);

    // 设置订单完成
    boolean setOk(String code);

    List<OrderForm> getExportList(
            String keyword, Integer projectType, Integer roleType, Integer status,
            String beginDate, String endDate, String payChannelCode, Integer financeStatus, String goodsName
    );

    // 财务驳回订单付款
    boolean refuseBankPay(String code);

    // 财务撤回订单付款
    boolean revocationBankPay(String code);

    PageDto<OrderForm> pageListXml(PageUtil pageUtil, String keyword, Integer stockOutMethod, Integer status, String goodsName);

    // 财务审核
    boolean updateFinanceStatus(String code, Integer financeStatus, String financeStatusName);

    boolean updateSaleStaff(String code, String saleStaffUid, String saleStaffName, String saleStaffPhone);

    List<OrderForm> listByCodes(List<String> orderCodes);

    List<OrderForm> makeupList();
}
